<template>
  <div class="search">
    <a-descriptions title="流程实例详细信息" :column="2" :bordered="true">
      <a-descriptions-item label="实例ID">{{processInstance.id}}</a-descriptions-item>
      <a-descriptions-item label="业务ID">{{processInstance.businessKey}}</a-descriptions-item>
      <a-descriptions-item label="流程定义ID">{{processInstance['id']}}</a-descriptions-item>
      <a-descriptions-item label="流程Key">{{processInstance['processDefinitionKey']}}</a-descriptions-item>
      <a-descriptions-item label="流程名称">{{processInstance['processDefinitionName']}}</a-descriptions-item>
      <a-descriptions-item label="版本">{{processInstance['processDefinitionVersion']}}</a-descriptions-item>
      <a-descriptions-item label="开始时间">{{processInstance['startTime']}}</a-descriptions-item>
      <a-descriptions-item label="结束时间">{{processInstance['endTime']}}</a-descriptions-item>
      <a-descriptions-item label="启动人">{{processInstance['startUserId']}}</a-descriptions-item>
      <a-descriptions-item label="启东人姓名">{{processInstance['startUserName']}}</a-descriptions-item>
      <a-descriptions-item label="启动节点ID">{{processInstance['startActivityId']}}</a-descriptions-item>
      <a-descriptions-item label="耗时">{{processInstance['durationInMillis']}}</a-descriptions-item>
      <a-descriptions-item label="子流程ID">{{processInstance['superProcessInstanceId']}}</a-descriptions-item>
      <a-descriptions-item label="状态"><span v-if="processInstance.endTime==null">{{processInstance['suspended']?'挂起':'激活'}}</span> <span v-else>结束</span></a-descriptions-item>
      <a-descriptions-item label="删除原因">{{processInstance['deleteReason']}}</a-descriptions-item>
    </a-descriptions>
  </div>
</template>
<script>
  import api from './js/api'

  export default {
    name: 'ProcessInstanceDetails',
    props: {},
    data() {
      return {
        refs: this.$refs,
        api: Object.assign(api, this.api),
        isAdd: true,//是否是添加模式
        loaded: false,//是否加载完成
        processInstance: {}
      }
    },
    methods: {
      //查询明细
      setData(data) {
        this.datails = {}
        if (data && data.id) {
          this.http.get(this, {
            url: this.api.processInstance.queryById,
            params: {
              processInstanceId: data.id
            },
            success: function(me, data) {
              me.processInstance = data
            }
          })
        }
      }
    },
    created() {
    },
    components: {}
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
